// Logistics/SalesDetail/SalesDetail.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    salesField: [
      {label: '客户单位',field_id: 'Order_Client_Name'},
      {label: '出库单号',field_id: 'xiaoshouchukudan'},
      {label: '购货单位',field_id: 'gouhuodanwei'},
      {label: '送货地址',field_id: 'songhuodizhi'},
      {label: '联系人',field_id: 'lianxiren'},
      {label: '联系电话',field_id: 'lianxidianhua'},
      {label: '源单号',field_id: 'yuandanhao'},
      {label: '源单类型',field_id: 'yuandanleixing'},
      {label: '销售业务类型',field_id: 'xiaoshouyewuleixing'},
      {label: '出库日期',field_id: 'chukuriqi'},
      {label: '客户单号',field_id: 'kehudanhao'},
    ],
    goodsFiels: [
      {label: '产品编号',field_id: 'chanpinbianhao'},
      {label: '产品名称',field_id: 'chanpinmingchen'},
      {label: '生产日期',field_id: 'shengchanriqi'},
      {label: '规格型号',field_id: 'guigexinghao'},
      {label: '单位',field_id: 'danwei'},
      {label: '出库数量',field_id: ''},
      {label: '实发数量',field_id: 'shifashuliang'},
      {label: '批号',field_id: 'pihao'},
    ],
    goodsList: []
  },
  //获取货物列表
  getGoodsList(id){
    let url = `WLAuth/ChuKuHuoWu/${id}`;
    wx.$get(5,url).then(res => {
      if (res.errcode != 0) return;
      let goodsList = res.data.row || [];
      this.setData({goodsList})
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    let {salesorderid} = options,
      salesOrder = wx.getStorageSync('salesOrder');
    wx.removeStorageSync('salesOrder');
    this.setData({
      salesOrder,salesorderid
    });
    this.getGoodsList(salesorderid);
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },


  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})
